import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.ColorModel;
import java.awt.image.DirectColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;

public final class GraphicsBuffer implements ImageProducer, ImageObserver {
	public int[] anIntArray392;
	public int anInt393;
	public int anInt394;
	ColorModel aColorModel395;
	ImageConsumer anImageConsumer396;
	public Image anImage397;

	public GraphicsBuffer(int i, Component component, int i_1_) {
		anInt393 = i_1_;
		anInt394 = i;
		anIntArray392 = new int[i_1_ * i];
		(this).aColorModel395 = new DirectColorModel(32, 16711680, 65280, 255);
		anImage397 = component.createImage(this);
		method232();
		component.prepareImage(anImage397, this);
		method232();
		component.prepareImage(anImage397, this);
		method232();
		component.prepareImage(anImage397, this);
		method230(false);
	}

	public void method230(boolean bool) {
		if (bool) {
			for (int i = 1; i > 0; i++) {
				/* empty */
			}
		}
		Renderer2D.method455(anInt393, anInt394, anIntArray392);
	}

	public void method231(int i, int i_2_, Graphics graphics, boolean bool) {
		if (!bool) {
			method232();
			graphics.drawImage(anImage397, i_2_, i, this);
		}
	}

	@Override
	public synchronized void addConsumer(ImageConsumer imageconsumer) {
		(this).anImageConsumer396 = imageconsumer;
		imageconsumer.setDimensions(anInt393, anInt394);
		imageconsumer.setProperties(null);
		imageconsumer.setColorModel((this).aColorModel395);
		imageconsumer.setHints(14);
	}

	@Override
	public synchronized boolean isConsumer(ImageConsumer imageconsumer) {
		if ((this).anImageConsumer396 == imageconsumer) {
			return true;
		}
		return false;
	}

	@Override
	public synchronized void removeConsumer(ImageConsumer imageconsumer) {
		if ((this).anImageConsumer396 == imageconsumer) {
			(this).anImageConsumer396 = null;
		}
	}

	@Override
	public void startProduction(ImageConsumer imageconsumer) {
		addConsumer(imageconsumer);
	}

	@Override
	public void requestTopDownLeftRightResend(ImageConsumer imageconsumer) {
		System.out.println("TDLR");
	}

	public synchronized void method232() {
		if ((this).anImageConsumer396 != null) {
			(this).anImageConsumer396.setPixels(0, 0, anInt393, anInt394, ((this).aColorModel395),
				anIntArray392, 0, anInt393);
			(this).anImageConsumer396.imageComplete(2);
		}
	}

	@Override
	public boolean imageUpdate(Image image, int i, int i_3_, int i_4_, int i_5_, int i_6_) {
		return true;
	}
}
